package com.leiyuan.content.service;

import com.leiyuan.dto.CoursePreviewDto;
import com.leiyuan.po.CoursePublish;

import java.io.File;

/**
 * 课程预览、发布接口
 *
 * @author leiyuan
 * @version 1.0
 */
public interface CoursePublishService {

    /**
     * 获取课程预览信息
     * @param courseId 课程id
     * @return com.leiyuan.dto.CoursePreviewDto
     * @author leiyuan
    */
    public CoursePreviewDto getCoursePreviewInfo(Long courseId);

    /**
     * 提交审核
     * @param courseId  课程id
     * @return void
     * @author leiyuan
     */
    public void commitAudit(Long companyId,Long courseId);

    /**
     * 课程发布接口
     * @param companyId 机构id
     * @param courseId 课程id
     * @return void
     * @author leiyuan
     */
    public void publish(Long companyId,Long courseId);

    /**
     * 课程静态化
     * @param courseId  课程id
     * @return File 静态化文件
     * @author leiyuan
     */
    public File generateCourseHtml(Long courseId);
    /**
     * 上传课程静态化页面
     * @param file  静态化文件
     * @return void
     * @author leiyuan
     */
    public void  uploadCourseHtml(Long courseId, File file);

    //创建索引
    public Boolean saveCourseIndex(Long courseId) ;

    /**
     * 根据课程 id查询课程发布信息
     * @param courseId
     * @return
     */
    public CoursePublish getCoursePublish(Long courseId);

    /**
     * 查询缓存中的课程信息
     * @param courseId 课程id
     * @return com.leiyuan.po.CoursePublish
     * @author leiyuan
    */
    public CoursePublish getCoursePublishCache(Long courseId);
}
